#!/usr/bin/python
# -*- coding: UTF-8 -*-

from pypinyin import pinyin, lazy_pinyin, Style
import jieba
import re

s='我总部在上海'

seg_list = jieba.cut(s)

segs=' '.join(seg_list)

seg_list = segs.split(' ')

words=[]
WordPinYins=[]


for word in seg_list:
    print word
    
    word_pinyin=pinyin(word, style=Style.TONE3, heteronym=True)
    WordPinYin=''
    for t in word_pinyin:
        if len(t)!=1:
           t = [t[0]]
        WordPinYin=WordPinYin+t[0]+' '
    print WordPinYin
